package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.YikaTongPayBean;
import com.lwj.liwanjia.impl.YikatongPayView;
import com.lwj.liwanjia.model.YikatonPayModel;

import java.util.Map;

import rx.Subscriber;

/**
 * Created by Administrator on 2017/10/17.
 */

public class YktPayPresenter {
    private YikatongPayView yikatongPayView;
    private YikatonPayModel yikatonPayModel;

    public YktPayPresenter(YikatongPayView yikatongPayView) {
        this.yikatongPayView = yikatongPayView;
        yikatonPayModel = new YikatonPayModel();
    }

    public void getYktpayInfo(Map<String, Object> map) {
        if (yikatongPayView != null) {
            yikatonPayModel.getYktpayInfo(map, new Subscriber<YikaTongPayBean>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    yikatongPayView.showError((Exception) e);
                }

                @Override
                public void onNext(YikaTongPayBean yikaTongPayBean) {
                    yikatongPayView.getYktpayInfor(yikaTongPayBean);
                }
            });
        }
    }
}
